<template>
    <div id="app">
        <router-view />
    </div>
</template>

<script>
// import HelloWorld from "./components/HelloWorld.vue";
import "devtools-detect";
export default {
    name: "App",
    created() {
        this.MonitorKeyCode();
        this.TestingDevTools();
        !(function() {
            var timelimit = 50;
            var open = false;
            setInterval(function() {
                var starttime = new Date();
                // eslint-disable-next-line
                debugger;
                if (new Date() - starttime > timelimit) {
                    open = true;
                    window.stop();
                    window.location =
                        "http://qn.mao5088.com/common/common/support";  
                } else {
                    open = false;
                }
                console.log(open)
            }, 500);
        })();
    },
    methods: {
        MonitorKeyCode() {
            // 阻止F12 和 右键菜单
            document.onkeydown = function() {
                var e = window.event || arguments[0];
                console.log(e);
                if (e.keyCode === 123) {
                    return false;
                } else if (e.ctrlKey && e.shiftKey && e.keyCode === 73) {
                    return false;
                }
            };
            // 阻止右键菜单
            document.oncontextmenu = function() {
                return false;
            };
        },
        TestingDevTools() {
            // 检测浏览器调试是否打开
            window.addEventListener("devtoolschange", event => {
                console.log(event);
                if (event.detail.isOpen) {
                    window.location =
                        "http://qn.mao5088.com/common/common/support";
                }
                // alert(event.detail.isOpen)
                // console.log("Is DevTools open:", event.detail.isOpen);
                // console.log("DevTools orientation:", event.detail.orientation);
            });
        }
    }
};
</script>

<style>
#app {
    font-family: Avenir, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-align: center;
    color: #000;
    background: #ebebeb;
    /* min-width: 1200px; */
    /* margin-top: 60px; */
}
.flex_row {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
}
.flex_column {
    display: flex;
    flex-direction: column;
    flex-wrap: wrap;
}
.justify_content_around {
    justify-content: space-around;
}
.justify_content_between {
    justify-content: space-between;
}
.justify_content_center {
    justify-content: center;
}
.justify_content_end {
    justify-content: flex-end;
}
.justify_content_start {
    justify-content: flex-start;
}
.align_items_end {
    align-items: flex-end;
}
.align_items_center {
    align-items: center;
}
.align_items_start {
    align-items: flex-start;
}
.flex_wrap_no {
    flex-wrap: nowrap;
}
.text_center {
    text-align: center;
}
.text_left {
    text-align: left;
}
.text_right {
    text-align: right;
}
.c00_bg {
    background: #c00;
    color: #fff;
}
</style>
